<template>
  <!--无法检入项提示弹框 -->
  <m-modal
    v-model="visible"
    :width="520"
    class="v-unablecheckInPackageModal"
    mask
    :title="title"
    :showFooter="true"
    cancelText=""
    okText="确定"
    @cancel="handleCancel"
    @ok="handleOk"
  >
    <div>
      <div class="_content">
        <div class="_title">
          <img src="statics/images/mainpage/Warning.svg">某些项无法被检入
        </div>
        <div class="_desc">
          当前包下的某些包已被锁定，或者你没有相应权限，造成无法检入
        </div>
        <div class="_con">
          <a-table
            :columns="columns"
            :data-source="tableData"
            :pagination="false"
            :scroll="{ y: 150 }"
            :height="190"
          />
        </div>
      </div>
    </div>
  </m-modal>
</template>
<script>
import customModal from '../../common/CustomModal';
import { Portal } from 'src/components/common/Portal.vue';
const columns = [
  {
    title: '包',
    dataIndex: 'name',
    width: 101,
  },
  {
    title: '路径',
    dataIndex: 'path',
    width: 225,
  },
  {
    title: '原因',
    dataIndex: 'reason',
    width: 70,
  }
];
const com = {
  name: 'unablecheckInPackageModal',
  components: {
    'm-modal': customModal,
  },
  data() {
    return {
      visible: false,
      title: '无法检入项',
      columns,
    };
  },
  props: {
    tableData: {
      type: Array,
      default: [],
    },
  },
  computed: {},
  watch: {},
  mounted() {
    this.visible = true;
  },
  beforeCreate() {},
  beforeDestroy() {},
  methods: {
    handleOk(res) {
      this.visible = false;
      this.$emit('sure', res);
    },
    handleCancel() {
      this.visible = false;
      this.$emit('close');
    },
  },
};
export default com;
export const portal = new Portal(com, { single: true });
</script>
<style lang="scss" scoped>
.v-unablecheckInPackageModal {
	._content {
		padding: 16px;
		._title {
			width: 335px;
			height: 32px;
			font-size: 14px;
			font-weight: 500;
			color: rgba(0, 0, 0, 0.85);
			line-height: 24px;
			> img {
				margin-top: -4px;
				margin-right: 4px;
				line-height: 32px;
			}
		}
		._desc {
			width: 367px;
			height: 20px;
			margin-left: 20px;
			font-size: 12px;
			font-weight: 400;
			color: rgba(0, 0, 0, 0.65);
			line-height: 20px;
		}

		._con {
			width: 420px;
			height: 192px;
			margin: 0 auto;
			margin-top: 25px;
			font-size: 12px;
			font-weight: 400;
			color: rgba(0, 0, 0, 0.65);
			line-height: 20px;
			/deep/ .ant-table-content .ant-table-scroll {
				width: 420px;
				height: 192px;
				.ant-table-header {
					height: 40px;
					border: 1px solid #b1cee2;
          overflow: hidden !important;
					table {
						border-radius: 0;
						.ant-table-thead {
							tr th {
								padding: 9px;
								background: #d4ebf8;
							}
						}
					}
				}
				.ant-table-body {
					height: 150px;
					border: 1px solid #b1cee2;
					table {
						width: 408px;
						.ant-table-tbody {
							width: 408px;
							tr td {
								padding: 9px;
                font-size: 12px !important;
							}
						}
					}
				}
			}
		}
	}
}
</style>
